package org.example.provider;

import org.example.framework.Protocol;
import org.example.framework.ProtocolFactory;
import org.example.framework.ServerUrl;
import org.example.provider.api.HelloService;
import org.example.provider.impl.HelloServiceImpl;

/**
 * @author shenguangyang
 */
public class Provider {
    public static void main(String[] args) {

        ServerUrl httpServerUrl = new ServerUrl("http", "127.0.0.1", 8080, HelloService.class.getName(), HelloServiceImpl.class);
        Protocol httpProtocol = ProtocolFactory.getProtocol(httpServerUrl.getProtocol());
        httpProtocol.export(httpServerUrl);

//        ServerUrl dubboServerUrl = new ServerUrl("dubbo", "127.0.0.1", 8080, HelloService.class.getName(), HelloServiceImpl.class);
//        Protocol dubboProtocol = ProtocolFactory.getProtocol(dubboServerUrl.getProtocol());
//        dubboProtocol.export(dubboServerUrl);
    }
}
